package cn.doit.scala.day06.fanxing

/**
 * @DATE 2021/12/31/11:56
 * @Author MDK
 * @Version 2021.2.2
 * */
object C02_下界 {
  def m[T<:Cat](x:T):T={
    x
  }
  def main(args: Array[String]): Unit = {
    val cat = C02_下界.m(new Cat(1, "xiaobai"))
    println(cat)

    //如果传入dog类 dog类不属于cat子类泛型  报错
//    val dog = C02_下界.m(new Dog(1, "xiaohei"))
//    println(dog)
val cat1 = C02_下界.m(new SmallCat)
    println(cat1)

  }
}
